package com.ogilvy.audi.dao.impl;

import java.util.Map;

import org.springframework.stereotype.Repository;

import com.ogilvy.audi.bean.Album;
import com.ogilvy.audi.bean.Comment;
import com.ogilvy.audi.dao.CommentDao;
import com.ogilvy.frame.hibernate.BaseDaoImpl;
import com.ogilvy.frame.page.PageTools;
@Repository
public class CommentDaoImpl extends BaseDaoImpl<Comment> implements CommentDao{
	public PageTools<Comment> selectAll(int pageNo, int pageSize,Map<String,Object> condition){
		System.out.println("圈子评论查询");
		StringBuffer hql = new StringBuffer("from Comment t join t.circle c where 1=1");
		if(condition.get("circleId")!=null){
			hql.append(" and c.circleId =").append(condition.get("circleId"));
		}
		System.out.println("输出hql:"+hql);
		PageTools<Comment> plist = this.findByHql(pageNo, pageSize, hql.toString());
		//PageTools<Circle> plist = null;
		return plist;
	}
	public PageTools<Comment> selectAll(Map<String,Object> condition){
		return null;
	}
}
